<?php

class cntrlerror implements viewController {
	private $area;
	private $side;
	private $dependencies = array("JavaScript" => array(), "CSS" => array("hideSidebar.css", "hideTitle.css"), "InlineJavaScript" => array() );
	private $pageName = "PicBoard Error";
	private $userObj;
	private $tools = "";

	public function __construct(user &$userObj){
		require_once(SYS_SYSDIR . "core/errors.php");
		
		parse_str( $_GET['act'] );
		
		$errors = unserialize(SYS_ERRORMAP);
		
		$id = (isset($id) == false || array_key_exists($id, $errors) == false) ? 1 : $id;
		
		$this->pageName = $errors[$id][0];
	
		$this->area = new template("area.error");
		
		$this->area->replace('errorTitle', $errors[$id][0]);
		$this->area->replace('details', $errors[$id][1]);
	
	}
	
	
	// Controller functions
	public function getSide(){
		return $this->side;
	}
	
	public function getArea(){
		return $this->area;
	}
	
	public function getDependencies(){
		return $this->dependencies;
	}
	
	public function getPageName(){
		return $this->pageName;	
	}
	
	public function getTools(){
		return $this->tools;
	}

}

?>